<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends HomeController {
    public function index(){
    	//统计商城所有产品
    	$itemcount=M('item')->where('isdel=%d',0)->count();
    	//成交订单(已收货订单)
    	$status=9;//订单的状态为已发货
    	$temp=M('order')->query('SELECT COUNT(*) as ordercount FROM '.C('DB_PREFIX')."order WHERE (pay_status+shipping_status+order_status=$status)");
    	$ordercount=$temp[0]['ordercount'];
    	//运营商
    	$yuncount=M('yunying_user')->where('isdel=%d',0)->count();
    	//加盟商
    	$shopcount=M('shop_user')->where('isdel=%d',0)->count();
    	//供货商
    	$suppercount=M('supper_user')->where('isdel=%d',0)->count();
    	$this->assign('item',$itemcount);
    	$this->assign('ordercount',$ordercount);
    	$this->assign('yuncount',$yuncount);
    	$this->assign('shopcount',$shopcount);
    	$this->assign('suppercount',$suppercount);
    	$this->display();
    }
}